home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 60 / 60.xpi / chrome / webdeveloper.jar / content / webdeveloper / common / platform.js < prev    next >
Text File  |  2009-06-30  |  562b  |  21 lines

  1. // Returns true if the extension is running on a Mac
  2. function webdeveloper_isMac()
  3. {
  4.     var appInfo = Components.classes["@mozilla.org/xre/app-info;1"];
  5.  
  6.     // If app info is set
  7.     if(appInfo)
  8.     {
  9.         // If the OS is set to Darwin
  10.         if(appInfo.getService(Components.interfaces.nsIXULRuntime).OS == "Darwin")
  11.         {
  12.             return true;
  13.         }
  14.     }
  15.     else if(!webdeveloper_isPreferenceSet("general.platform.override") && navigator.platform.indexOf("Mac") == 0)
  16.     {
  17.         return true;
  18.     }
  19.  
  20.     return false;
  21. }